﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Areas/Admin/Content/reset.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Areas/Admin/Content/base.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Areas/Admin/Content/form.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Areas/Admin/Content/main.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Areas/Admin/Scripts/jquery.treeview/jquery.treeview.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Areas/Admin/Scripts/jquery.treetable/jquery.treeTable.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Areas/Admin/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Areas/Admin/Scripts/jquery-ui.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Areas/Admin/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Areas/Admin/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Areas/Admin/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Areas/Admin/Scripts/jquery.treeview/jquery.treeview.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Areas/Admin/Scripts/json2.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Areas/Admin/Scripts/admin.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Areas/Admin/Scripts/jquery.treetable/jquery.treeTable.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        @{
            var adminController = ViewContext.Controller as AdminControllerBase;
        }
        window.websiteId = @adminController.CurrentWebsiteId;
        window.pageTypeId = @adminController.CurrentWebsiteId;

        $(document).ready(function () {
            setTimeout(function () { $('.message').hide(); }, 5000);

            $('.quick-nav .more').click(function () {
                var ul = $(this).siblings('ul');
                if (ul.hasClass('hide')) {
                    ul.slideDown('fast').removeClass('hide');
                } else {
                    ul.slideUp('fast').addClass('hide');
                }
            });

            $('body').click(function (evt) {
                if (!$(evt.target).is('.quick-nav .more')) {
                    $('.quick-nav .more').siblings('ul').slideUp('fast').addClass('hide');
                }
            });

            $('.data-table .delete').click(function () {
                return confirm('@("Are you sure you want to pemanently delete this item?".Localize())');
            });
        });
    </script>
</head>
<body>
    <div id="container">
        <div id="header">
            <h1>
                @Html.ActionLink("Susu CMS".Localize(), "Index", "Home")
            </h1>
            <ul class="quick-nav">
                <li>@Html.ActionLink(string.IsNullOrWhiteSpace(Context.User.Identity.Name) ? "Anonymous User".Localize() : Context.User.Identity.Name, "ChangePassword", "Account")
                    | </li>
                <li><a href="#">Setting</a> - </li>
                <li><a href="#">Help</a> - </li>
                <li>@Html.ActionLink("Logout", "Logout", "Account")</li>
            </ul>
            <div class="message">
                @if (TempData.ContainsKey("Message"))
                {
                    <span>@(TempData["Message"].ToString().Localize())</span>
                }
                else if (TempData.ContainsKey("ErrorMessage"))
                {
                    <span class="error">@(TempData["ErrorMessage"].ToString().Localize())</span>
                }
            </div>
        </div>
        <div id="main">
            <div class="sidebar">
                @Html.Action("List", "Website")
            </div>
            <div class="content">
                @{
                    var controller = ViewContext.RouteData.GetRequiredString("controller").ToLower();
                    if (controller == "page" || controller == "pagetype")
                    {
                    <div class="left">
                        @Html.Action("List", "PageType")
                    </div>
                    <div class="right">
                        <div class="buttons">
                            <a href="javascript://" class="view-button"></a><a href="javascript://" class="setting-button">
                            </a>
                            <ul class="hide">
                                <li><a href="#">@("Close Website".Localize())</a></li>
                                <li><a href="#">Statistics</a></li>
                                <li><a href="#">Statistics</a></li>
                            </ul>
                        </div>
                        @RenderBody()
                    </div>
                    }
                    else
                    {
                    @RenderBody()
                    }
                }
            </div>
            <div class="clearfix">
            </div>
        </div>
        <div id="footer">
            <p>
                &copy; 2011 SusuCMS.com</p>
        </div>
    </div>
</body>
</html>
